<?php
class Championship extends AppModel {
	var $name = 'Championship';
	var $primaryKey = 'ID';
	var $useTable = 'rule_listing';
	var $order = array("Championship.strName COLLATE NOCASE" => "asc");

	var $belongsTo = array (
		'RuleType' => array (
			'className' => 'RuleType',
			'foreignKey' => 'idRule_Types',
			'fields' => array (
				'RuleType.ID',
				'RuleType.idStrings_Localized'
			)
		)
	);

	var $hasMany = array (
		'TeamRanking' => array (
			'className' => 'TeamRanking',
			'foreignKey' => 'idRule_Listing',
			'dependent' => true
			),
		'Calendar' => array (
			'className' => 'Calendar',
			'foreignKey' => 'idRule_Listing',
			'dependent' => true
			)
	);

	var $hasAndBelongsToMany = array (
		'Team' => array (
			'className' => 'Team',
			'joinTable' => 'team_ranking',
			'foreignKey' => 'idRule_Listing',
			'associationForeignKey' => 'idTeam_Listing',
			'unique' => false
		)
	);
}
?>